Skip to content

Conversation

@jonahgraham
Copy link
Contributor

@jonahgraham jonahgraham commented Nov 25, 2025

The fixedHandle does not have any drawable components, and as written today, what gtk4_draw does on fixedHandle is draw the whole Widget, then Display.snapshotDrawProc iterates through all the children, of which the normal handle will be one (at least in StyledText case) and gtk4_draw will be called again on the same widget.

This fixes caret drawing, because on the first time through gtk4_draw the caret is drawn, but then on the second time the gtk4_draw draws over the freshly drawn caret.

This is option 1 in #2812 (comment)

Fixes #2812

The fixedHandle does not have any drawable components, and as written
today, what gtk4_draw does on fixedHandle is draw the whole Widget,
then Display.snapshotDrawProc iterates through all the children, of
which the normal handle will be one (at least in StyledText case)
and gtk4_draw will be called again on the same widget.

This fixes caret drawing, because on the first time through gtk4_draw
the caret is drawn, but then on the second time the gtk4_draw draws
over the freshly drawn caret.

This is option 1 in eclipse-platform#2812 (comment)

Fixes eclipse-platform#2812
@github-actions
Copy link
Contributor

Test Results

  118 files  ±0    118 suites  ±0   17m 32s ⏱️ + 1m 17s
4 653 tests ±0  4 636 ✅ ±0  17 💤 ±0  0 ❌ ±0 
  338 runs  ±0    334 ✅ ±0   4 💤 ±0  0 ❌ ±0 

Results for commit 56a6c40. ± Comparison against base commit a0d6ffc.

@jonahgraham
Copy link
Contributor Author

This is option 1 in #2812 (comment)

Option 2 doesn't work, so this is the only option I provide.

@jonahgraham
Copy link
Contributor Author

This fix by itself breaks other things. I am writing a test to make sure that Paint event is sent exactly once on a redraw, but that shows some other Widgets are not getting their paint event now with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[GTK4] Caret not being drawn in StyledText

1 participant